<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="/wondershare/js/jquery.js"></script> 
 <script src="/wondershare/js/jquery-ui.min.js"></script>
<link href="/wondershare/styles/jquery-ui.css" rel="stylesheet" type="text/css"/>
<link href="/wondershare/styles/main.css" rel="stylesheet" type="text/css" />
<link href="/wondershare/styles/general.css" rel="stylesheet" type="text/css" />
<title>产品Pad生成xml页</title>
<script>
 $(document).ready(function() 
 {
 

	has_manage();
    $("#product_pub_date").datepicker(  
   {  
     dateFormat:'yy-mm-dd',  // 设置日期格式  
   });  
   
    $("#Char_Desc_45").keyup(function(){   
	if($("#Char_Desc_45").val().length > 45)
	{
	   $("#Char_Desc_45").val($("#Char_Desc_45").val().substring(0,45) );
	}
	});
	
	 $("#Char_Desc_80").keyup(function(){   
	if($("#Char_Desc_80").val().length > 80)
	{
	   $("#Char_Desc_80").val($("#Char_Desc_80").val().substring(0,80) );
	}
	});
	
	 $("#Char_Desc_250").keyup(function(){   
	if($("#Char_Desc_250").val().length > 250)
	{
	   $("#Char_Desc_250").val($("#Char_Desc_250").val().substring(0,250) );
	}
	});
	
	 $("#Char_Desc_450").keyup(function(){   
	if($("#Char_Desc_450").val().length > 450)
	{
	   $("#Char_Desc_450").val($("#Char_Desc_450").val().substring(0,450) );
	}
	});
	
	 $("#Char_Desc_2000").keyup(function(){   
	if($("#Char_Desc_2000").val().length > 2000)
	{
	   $("#Char_Desc_2000").val($("#Char_Desc_2000").val().substring(0,2000) );
	}
	});
	
  });
  
function  add_file(nums)
{
    
   var nums = parseInt($("#web_nums").val())+nums; 
   $("#web_nums").val(nums);
   var add_file = '<tr id="file_xml_'+nums+'"> <td class="label">Application_XML_File_URL：</td><td><input type="text" size="60" style="float:left;" '+  
   'name="Application_XML_File_URL_'+nums+'" id="Application_XML_File_URL_'+nums+'">&nbsp;&nbsp;<select name="web_'+nums+'" id="web_'+nums+'"  style="width:100px;">'+
   ' <option value="wondershare"  >wondershare</option><option value="aimersoft" >aimersoft</option><option value="Either/Or" >anypdftools</option></select></td></tr>';

   $("#add_web_pad").before(add_file);
}
function on_size_manage()
{
  if($("#File_Size_MB").val().replace(/(^\s*)|(\s*$)/g, "")=="")
   {
       $("#File_Size_K").val('');
	   $("#File_Size_Bytes").val('');
   }else
   {
     var re = /^[0-9]+.?[0-9]*$/;   //判断字符串是否为数字     //判断正整数 /^[1-9]+[0-9]*]*$/   
     if (!re.test($("#File_Size_MB").val()))
    {
        alert("请输入数字！");
        $("#File_Size_MB").focus();
        return false;
     }
     $("#File_Size_K").val(parseInt($("#File_Size_MB").val())*1024);
      $("#File_Size_Bytes").val(parseInt($("#File_Size_MB").val())*1024*1024);
	}
}
function has_manage()
{

   if($("#Has_Expire_Info").val() == 'N')
   {
     $("#Expire_Count").attr('disabled',"disabled");
	 $("#Expire_Based_On").attr('disabled',"disabled");
   }else
   {
     $("#Expire_Count").attr('disabled',"");
	 $("#Expire_Based_On").attr('disabled',"");
	}
}
 
function  check_submit()
{
	 var web_nums = $("#web_nums").val() ;
	 var web_type = '';
	 var web_file_url = '';
	for (i = 1;i<= web_nums;i++)
	{
	   web_type = $("#web_"+i).val();
	   web_file_url = $("#Application_XML_File_URL_"+i).val();
	   if(web_file_url.replace(/(^\s*)|(\s*$)/g, "")!="")
	   {
		   if(web_type == 'wondershare')
		   {
			 if(web_file_url.indexOf('http://www.wondershare.com.br') == -1)
			 {
			   alert(web_file_url+'地址中不含有http://www.wondershare.com.br！');
			   return false;
			 }
			 if(web_file_url == 'http://www.wondershare.com.br/pads/.xml')
			 {
			   alert(web_file_url+'地址中应该填写文件名！');
			   return false;
			 }
		   }
	   }
	}
	return true;
}
</script>
</head>
<body>
<h1>
<{if  $form_act == "update"}>
	<{foreach from=$pdf_file_data item=item key=key }>
	<{assign var="key0" value=$key+1}> 
	<span class="action-span">
	<a href="/wondershare/product_pad.php?action=download&server_file_path=<{$item.server_file_path}>" >下载<{$item.file_url}></a>
	</span>
	
	<{/foreach}>
<{/if}>	  
<span class="action-span1">
PAD产品生成XML</a>
</span> 
<span id="search_id" class="action-span1"> > <{$product_name}></span>
<div style="clear:both"></div>
</h1>
<div id="tabbar-div">
      <p>
     
      </p>
    </div>
<div id="tabbody-div"  style=" width:1100px;">
      <form  name="theForm" method="post" action="/wondershare/product_pad.php?action=add_update_xml" onsubmit="return check_submit();">
        <table align="center" width="90%" id="general-table">
          <tbody>
		  <tr>
            <td class="label">产品名称：</td>
            <td><span style="color:#FF0000"><b><{$product_name}></b></span></td>
          </tr>
		  <tr>
            <td class="label">产品发布日期：</td>
            <td><input type="text" size="30" style="float:left;color:;"  name="product_pub_date" id="product_pub_date" value="<{$pdf_data.pdf_pub_date}>"> </td>
          </tr>
		  <tr>
            <td class="label">产品语言：</td>
            <td>
			<select name="product_language"  style="width:230px;" > 
			<{$option_language}>
			</select>
            </td>
          </tr>
		  <tr>
            <td class="label">产品pdf分类：</td>
            <td>
			<select name="product_pdf_category"  style="width:430px;"> 
			<{$option_category}>
			</select>
            </td>
          </tr>
		  <tr>
            <td class="label">Program_Type：</td>
            <td>
			<select name="Program_Type"  style="width:430px;">
			<option value="Shareware" <{if $pdf_data.Program_Type == 'Shareware' || !$pdf_data.program_type }> selected="selected" <{/if}> >Shareware</option> 
			<option value="Freeware" <{if $pdf_data.Program_Type == 'Freeware'}> selected="selected" <{/if}> >Freeware</option>
			</select>
            </td>
          </tr>
		   <tr>
            <td class="label">Program_System_Requirements：</td>
            <td>
			<input type="text" size="60" style="float:left;color:;"  name="Program_System_Requirements" id="Program_System_Requirements" value="<{$pdf_data.Program_System_Requirements}>">
            </td>
          </tr>
		  <tr>
            <td class="label">File_Size_Bytes：</td>
            <td><input type="text" size="60" style="float:left;color:;"  name="File_Size_Bytes" id="File_Size_Bytes" value="<{$pdf_data.File_Size_Bytes}>">
            </td>
          </tr>
		  <tr>
            <td class="label">File_Size_K：</td>
            <td><input type="text" size="60" style="float:left;color:;"  name="File_Size_K" id="File_Size_K" value="<{$pdf_data.File_Size_K}>" >
            </td>
          </tr>
		  <tr>
            <td class="label">File_Size_MB：</td>
            <td><input type="text" size="60" style="float:left;color:;"  name="File_Size_MB" id="File_Size_MB"  onchange="on_size_manage()" value="<{$pdf_data.File_Size_MB}>" >
            <span style="color:#FF0000">输入此选项上面File_Size_Bytes和File_Size_K会跟着变动</span></td>
          </tr>
		 <tr>
            <td class="label">Has_Expire_Info：</td>
            <td><select name="Has_Expire_Info"  id="Has_Expire_Info"  style="width:430px;" onchange="has_manage();"> 
			<option value="N"  <{if $pdf_data.Has_Expire_Info == "N" }> selected="selected" <{/if}> >N</option>
			<option value="Y"  <{if $pdf_data.Has_Expire_Info == "Y" }> selected="selected" <{/if}> >Y</option>
			<option value="M" <{if $pdf_data.Has_Expire_Info == "M" }> selected="selected" <{/if}> >M</option>
			<option value="D" <{if $form_act == "add" }> selected="selected"   <{else}>  <{if $pdf_data.Has_Expire_Info == "D" }> selected="selected" <{/if}> <{/if}>  >D</option>
			</select>
            </td>
          </tr> 
		   <tr>
            <td class="label">Expire_Count：</td>
            <td><select name="Expire_Count" id="Expire_Count"   style="width:430px;"> 
			<{$option_days}>
			</select>
            </td>
          </tr> 
		   <tr>
            <td class="label">Expire_Based_On：</td>
            <td><select name="Expire_Based_On" id="Expire_Based_On"  style="width:430px;"> 
			<option value="Days" <{if $form_act == "add" }> selected="selected"   <{else}> <{if $pdf_data.Expire_Based_On == "Days" }> selected="selected" <{/if}>  <{/if}>  >Days</option>
			<option value="Uses" <{if $pdf_data.Expire_Based_On == "Uses" }> selected="selected" <{/if}>  >Uses</option>
			<option value="Either/Or"  <{if $pdf_data.Expire_Based_On == "Either/Or" }> selected="selected" <{/if}>  >Either/Or</option>
			</select>
            </td>
          </tr> 
		   <tr>
            <td class="label">试用版限制内容：</td>
            <td><input type="text" size="60" style="float:left;color:;"  name="Expire_Other_Info" id="Expire_Other_Info" value="<{$pdf_data.Expire_Other_Info}>" >
            </td>
          </tr> 
		 
		  <tr>
            <td class="label">Keywords：</td>
            <td><input type="text" size="60" style="float:left;color:;"  name="Keywords" id="Keywords" <{if $pdf_data.Keywords}> value="<{$pdf_data.Keywords}>" <{else}>
			value="<{$Keywords}>" <{/if}> >
            </td>
          </tr> 
		   <tr>
            <td class="label">Char_Desc_45：</td>
            <td><textarea wrap="on"  name="Char_Desc_45" id="Char_Desc_45" rows="2" cols="60"><{$pdf_data.Char_Desc_45}></textarea><span style="color:#FF0000">限制字数45个</span>
            </td>
          </tr> 
		   <tr>
            <td class="label">Char_Desc_80：</td>
            <td>
			<textarea wrap="on"  name="Char_Desc_80" id="Char_Desc_80" rows="4" cols="60"><{$pdf_data.Char_Desc_80}></textarea><span style="color:#FF0000">限制字数80个</span>
            </td>
          </tr> 
		   <tr>
            <td class="label">Char_Desc_250：</td>
            <td><textarea wrap="on"  name="Char_Desc_250" id="Char_Desc_250" rows="4" cols="60"><{$pdf_data.Char_Desc_250}></textarea><span style="color:#FF0000">限制字数250个</span>
            </td>
          </tr> 
		   <tr>
            <td class="label">Char_Desc_450：</td>
            <td><textarea wrap="on"  name="Char_Desc_450" id="Char_Desc_450" rows="6" cols="60"><{$pdf_data.Char_Desc_450}></textarea><span style="color:#FF0000">限制字数450个</span>
            </td>
          </tr>   
		   <tr>
            <td class="label">Char_Desc_2000：</td>
            <td><textarea wrap="on"  name="Char_Desc_2000" id="Char_Desc_2000" rows="10" cols="60"><{$pdf_data.Char_Desc_2000}></textarea><span style="color:#FF0000">限制字数2000个</span>
            </td>
          </tr>    
		  
		  <tr>
            <td class="label">Application_Screenshot_URL：</td>
            <td><input type="text" size="60" style="float:left;color:;"  name="Application_Screenshot_URL" id="Application_Screenshot_URL" value="<{$pdf_data.Application_Screenshot_URL}>" >
            </td>
          </tr>  
		   <tr>
            <td class="label">Affiliates_URL：</td>
            <td><input type="text" size="60" style="float:left;color:;"  name="Affiliates_URL" id="Affiliates_URL" <{if $pdf_data.Affiliates_URL }>  
			 value="<{$pdf_data.Affiliates_URL}>"  <{else}>   value="http://www.asp-shareware.org/pad/extensions/Affiliates.htm" <{/if}> >
            </td>
          </tr>   
		  
		  <{foreach from=$pdf_file_data item=item key=key }>
		  <{if $form_act == 'update' }>
		   <{assign var="key0" value=$key+1}>
		   <{else}>
		    <{assign var="key0" value=$key}>
			<{/if}>
		  <tr id="file_xml_<{$key0}>">
            <td class="label">Application_XML_File_URL：</td>
            <td><input type="text" size="60" style="float:left;color:;"  name="Application_XML_File_URL_<{$key0}>" id="Application_XML_File_URL_<{$key0}>" 
			<{if $item.file_url }>  value="<{$item.file_url}>" <{else}> value="http://www.wondershare.com/pads/.xml" <{/if}>   >&nbsp;&nbsp;
			<select name="web_<{$key0}>" id="web_<{$key0}>"   style="width:100px;"> 
			<option value="wondershare" <{if $item.web_name == "wondershare" }> selected="selected" <{/if}>   >wondershare</option>
			<option value="aimersoft" <{if $item.web_name == "aimersoft" }> selected="selected" <{/if}>  >aimersoft</option>
			<option value="anypdftools" <{if $item.web_name == "anypdftools" }> selected="selected" <{/if}>  >anypdftools</option>
			</select>
            </td>
          </tr>
		  <{/foreach}>
		  
		  <tr id="add_web_pad">
		  <td></td>
		  <td><input type="button" value="添加其他网站xml文件名" id="button_file" name="button_file"   onclick="add_file(1)"  />
		  
		  </td></tr>
		  

        </tbody></table>

        <div  style="margin-left:380px; margin-top:20px;">
          <input type="hidden"  name="web_nums" id="web_nums" value="<{$nums}>">
		  <input type="hidden"  name="product_id" id="product_id" value="<{$product_id}>">
		  <input type="hidden"  name="pdf_id" id="pdf_id" value="<{$pdf_data.pdf_id}>  ">
		  <input type="hidden"  name="product_name" id="product_name" value="<{$product_name}>">
		  <input type="hidden" value="<{$form_act}>" name="act" >
          <input type="submit"   class="button" value=" <{$title}>产品PAD " name="sub_from">
          <input type="reset" class="button" value=" 重置 ">
        </div>
      </form>
    </div>
</body>
</html>